package backend.majiong.yaku;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

import backend.MainGame;
import backend.majiong.Pai;
import backend.majiong.Player;

public abstract class AbstractYaku {

    public abstract boolean checkYaku(Player player,HandCombo combo,MainGame mainGame);

    public abstract String getYakuName();
    
    public abstract Integer getYakuNum(boolean isMenQing);
    
    
    public void sortHai(List<Pai> list) {
        Collections.sort(list, new Comparator<Pai>() {

            @Override
            public int compare(Pai o1, Pai o2) {
                int rs = o1.getType().compareTo(o2.getType());
                if (rs != 0)
                    return rs;
                return o1.getNum().compareTo(o2.getNum());
            }

        });
    }
}
